﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SeaBattle.Domain.Entities;

namespace SeaBattle.UI.Web.Models
{
    public class GameResultModel
    {
        public Game Game { get; set; }
        public Player Winner { get; set; }
        public Player Loser { get; set; }
        public Field WinnerField { get { return Game.realField[Winner]; } }
        public Field LoserField { get { return Game.realField[Loser]; } }
        public string CellClass(Field field, int x, int y)
        {
            switch (field.AField[x, y])
            {
                case FieldType.TYPEACSESS:
                    return "acsess";
                case FieldType.TYPENOACSESS:
                    return "noacsess";
                case FieldType.TYPECLOSEDACSESS:
                    return "closedacsess";
                case FieldType.TYPENONE:
                    return "none";
                case FieldType.TYPEHIT:
                    return "hit";
                case FieldType.TYPEMISS:
                    return "miss";
            }
            return "ship";
        }
    }
}